import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter)
let router=new VueRouter({
    mode:'hash',
    routes:[
        {
            path:'/newcar',
            name:'newcar',
            component:()=>import('@/views/NewCar.vue'),
            children:[
                {
                    path:'newenergy',
                    name:'newenergy',
                    component:()=>import('@/views/newcar/NewEnergy.vue')
                },
                {
                    path:'car',
                    name:'car',
                    component:()=>import('@/views/newcar/Car.vue')
                },
                {
                    path:'luxurybrand',
                    name:'luxurybrand',
                    component:()=>import('@/views/newcar/LuxuryBrand.vue')
                }
            ]
        },
        {
            path:'/newpower',
            name:'newpower',
            component:()=>import('@/views/NewPower.vue')
        },
        {
            path:'/find',
            name:'find',
            component:()=>import('@/views/Find.vue')
        },
        {
            path:'/usedcar',
            name:'usedcar',
            component:()=>import('@/views/UsedCar.vue')
        },
        {
            path:'/mine',
            name:'mine',
            component:()=>import('@/views/Mine.vue')
        },
        {
            path:'/',
            redirect:{
                path:'/newcar/newenergy'
            }
        }
    ]
})
export default router